// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   DOGRCDL.java

package p1;

import java.io.PrintStream;

// Referenced classes of package p1:
//            GTDDOG, DOGException

public class DOGRCDL extends GTDDOG
{

    public DOGRCDL()
    {
    }

    public void CallWriteDog()
        throws DOGException
    {
        int retCode;
        if((retCode = WriteDog()) != 0)
            throw new DOGException(retCode);
        else
            return;
    }

    public int getSerialNumber()
        throws DOGException
    {
        int serialno = 0;
        char toPrint[] = new char[DogBytes];
        int retCode;
        if((retCode = ReadDog()) != 0)
            throw new DOGException(retCode);
        if(DogBytes > 0)
        {
            for(int i = 0; i < DogBytes; i++)
                toPrint[i] = (char)DogData[i];

        } else
        {
            serialno = (DogData[0] + 256) % 256 + ((DogData[1] + 256) % 256) * 256 + ((DogData[2] + 256) % 256) * 0x10000 + ((DogData[3] + 256) % 256) * 256 * 0x10000;
        }
        return serialno;
    }

    public int getSerialNumber2()
        throws DOGException
    {
        int serialno = 0;
        DogAddr = 0;
        DogBytes = 6;
        char toPrint[] = new char[DogBytes];
        int retCode;
        if((retCode = ReadDog()) != 0)
            throw new DOGException(retCode);
        if(DogBytes > 0)
        {
            for(int i = 0; i < DogBytes; i++)
                toPrint[i] = (char)DogData[i];

        } else
        {
            serialno = (DogData[0] + 256) % 256 + ((DogData[1] + 256) % 256) * 256 + ((DogData[2] + 256) % 256) * 0x10000 + ((DogData[3] + 256) % 256) * 256 * 0x10000;
        }
        return serialno;
    }

    public void CallReadDog()
        throws DOGException
    {
        int serialno = 0;
        char toPrint[] = new char[DogBytes];
        int retCode;
        if((retCode = ReadDog()) != 0)
            throw new DOGException(retCode);
        if(DogBytes > 0)
        {
            for(int i = 0; i < DogBytes; i++)
            {
                toPrint[i] = (char)DogData[i];
                System.out.print(toPrint[i]);
            }

            System.out.println(new String(toPrint));
        } else
        {
            serialno = (DogData[0] + 256) % 256 + ((DogData[1] + 256) % 256) * 256 + ((DogData[2] + 256) % 256) * 0x10000 + ((DogData[3] + 256) % 256) * 256 * 0x10000;
        }
    }

    public static void main(String args[])
    {
        DOGRCDL dog = new DOGRCDL();
        try
        {
            System.out.println(dog.getSerialNumber2());
        }
        catch(Exception e)
        {
            System.out.println("===".concat(String.valueOf(String.valueOf(e))));
        }
    }
}
